// 列表头按钮配置
import {getDict} from "@/api/common";
import url from "@/axios/url";
const { mesUrl, adminUrl, wmsUrl } = url()
export const exportUrl = `${mesUrl}reportOperate/reworkVosExport`

export const exportExlUrl = `${mesUrl}reportOperate/preparationReworkExport/`

// 行末按钮配置
export const rowConfig = [
  {
    name: $i18n.t("common.view"),
    type: "primary",
    class: "row-btn-primary",
    handleName: "view", // 点击时返回的标识
  },
  {
    name: '导出',
    type: 'primary',
    class: 'row-btn-primary',
    handleName: 'exportExl', // 点击时返回的标识,
  },
];
export function evolve(status) {
  switch (status) {
    case 'Y':
      return '返工结束'
    case 'N':
      return '返工中'
    default:
      return '-'
  }
}

export function orderSource(status) {
  switch (status) {
    case 0:
    case '0':
      return '整备返工'
    case 1:
    case '1':
      return '终检返工'
    default:
      return '-'
  }
}

// 搜索条件配置
export const searchConfig = {
  data() {
    const self = this;
    return {
      searchDialog: {
        inline: true,
        formDesc: {
          modelName: {
            type: "input",
            label: '车型',
          },
          vinCode: {
            type: "input",
            label: 'VIN编码',
          },
          uwbCode: {
            type: "input",
            label: 'UWB编码',
          },
          // receiveCarTimeDate: {
          //   type: "daterange",
          //   label: "接车时间",
          //   attrs: {
          //     valueFormat: "yyyy-MM-dd",
          //     searchArrKey: ["receiveCarTimeMin", "receiveCarTimeMax"],
          //   },
          // },
          // departureTimeDate: {
          //   type: "daterange",
          //   label: "离场时间",
          //   attrs: {
          //     valueFormat: "yyyy-MM-dd",
          //     searchArrKey: ["departureTimeMin", "departureTimeMax"],
          //   },
          // },
        },
      },
    };
  },
};

export const operateList = [
  {
    name: $i18n.t("common.export"),
    type: "primary",
    icon: "el-icon-download",
    handleName: "export", //点击时返回的标识
    url: exportUrl,
    //auth: "auth:operlog:export", //权限字段
  },
]
// 新增/删除表单配置
